<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>{$user_login}  - 餐饮管理</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <div id="container" style="width:900px;">

             <div id="header" style="background-color:#FFA500;">
                   <h1 style="margin-bottom:0;">餐饮管理系统</h1></div>

                    <div id="menu" style="background-color:#FFD700;height:500px;width:100px;float:left;">
                    <foreach name="list" item="vo">
                        <b class="shuxing" id="{$vo.id}" onclick="">{$vo.classify_name}</b><br>
                    </foreach>
                    </div>
                      <div id="content"  style="background-color:#EEEEEE;height:500px;width:700px;float:left;">
                          <tr>
                              <td></td>
                          </tr>
                      </div>
                    <div style="background-color:#FFD700;height:500px;width:100px;float:right;">
                    </div>
                     <div id="footer" style="background-color:#FFA500;clear:both;text-align:center;">
                     版权 © runoob.com
                     <b style="float:right;margin-right: 30px;">挂单</b>
                     </div>

              </div>
    </body>
</html>
<script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
<script src="__TMPL__/public/assets/js/jquery-migrate-1.2.1.js"></script>
<script>
        $(".shuxing").each(function(){
           $(this).click(function(){
               var zhi = $(this).attr('id');
               $.ajax({
                  type:"POST",
                  url:"/home/Cashier/goodlist",
                  data:"goodclass="+zhi,
                  success:function(date){
                     var data=date.msg;
                     var content='';
                     for(var i=0;i<data.length;i++){
                         content += '<tr><td class="gooattr">'+data[i].g_id+data[i].g_goodsname+data[i].format+data[i].price+"</td></tr>"; 
                     } 
                     $("#content").html(content);
                     $(".gooattr").click(function(){
                        var too = $("td").val("class");
                        alert(too);
                        $.ajax({
                            type:"POST",
                            url:"/home/Cashier/goodsorder",
                            data:"goodclass="+too,
                            success:function(dayy){
                                alert(dayy);
                            }
                        });
                     });
                  }
               });
           }) ;
        });
    
</script>
